USBOpenPipe
The
USBOpenPipe
function sets up a connection to a specified endpoint and returns a pipe reference (
USBPipeRef
) to this connection. This reference is passed to the USB on all subsequent data transactions for this pipe. See the
USBControlRequest
for information about performing data transactions.
OSStatus USBOpenPipe(USBPB *pb);
Required fields in the
USBPB
parameter block for the
USBOpenPipe
function are
-
--> pbLength
-
Length of parameter block
-
--> pbVersion
-
Parameter block version number
-
--> usbCompletion
-
The completion routine
-
--> usbRefcon
-
General-purpose value passed back to the completion routine
-
<--> usbReference
-
--> Device reference of device to be opened
<-- Reference to the pipe opened
-
--> usbClassType
-
Type of endpoint (
kUSBBulk
,
kUSBInterrupt
,
kUSBIsoc
)
-
--> usbOther
-
The endpoint number within the device to open a pipe to, the endpoint number from the endpoint descriptor
-
--> usbWValue
-
maxPacketSize
-
--> usbFlags
-
Indicates whether the direction of the endpoint to be opened is in or out (
kUSBIn
,
kUSBOut
)
Note
At present there is little error checking performed by this function.
The errors returned by the
USBOpenPipe
function include:
kUSBUnknownDeviceErr
|
-6998
|
usbReference
does not refer to a current device
|
kUSBIncorrectTypeErr
|
-6995
|
tried to open a control or isochronous pipe
|
kUSBTooManyPipesErr
|
-6996
|
ran out of internal structures
|
© 1999 Apple Computer, Inc. Previous | Back Up One Level | Next | Show Frames | Hide Frames